cmake_minimum_required(VERSION 2.8)

project(numerical)


set(CMAKE_CXX_FLAGS "-std=c++11 -Wall")

set( CMAKE_BUILD_TYPE "Debug" )
#set( CMAKE_BUILD_TYPE "Release" )
#set( CMAKE_CXX_FLAGS "-O3" )


############### source and test ######################
include_directories(${PROJECT_SOURCE_DIR}/device)
include_directories(${PROJECT_SOURCE_DIR}/graphics)
include_directories(${PROJECT_SOURCE_DIR}/machine_learning)
include_directories(${PROJECT_SOURCE_DIR}/mcu)
include_directories(${PROJECT_SOURCE_DIR}/scientific)
include_directories(${PROJECT_SOURCE_DIR}/standard_template)


# 获取子文件夹下的所有源文件
aux_source_directory(device            subfolder_srcs0)
aux_source_directory(graphics          subfolder_srcs1)
aux_source_directory(machine_learning  subfolder_srcs2)
aux_source_directory(mcu               subfolder_srcs3)
aux_source_directory(scientific        subfolder_srcs4)
aux_source_directory(standard_template subfolder_srcs5)


# 定义要排除的文件列表
set(exclude_files mcu/mcu____f1c100s.c    mcu/mcu____f103zet6.c )

# 从所有源文件列表中移除要排除的文件
list(REMOVE_ITEM subfolder_srcs3 ${exclude_files})

message(" \n The value of exclude_files is: ${exclude_files}")

message(" \n The value of subfolder_srcs3 is: ${subfolder_srcs3}")

# 添加源文件到可执行文件或库
add_executable(exe_file zzzall_test.c
    ${subfolder_srcs0}
    ${subfolder_srcs1}
    ${subfolder_srcs2}
    ${subfolder_srcs3}
    ${subfolder_srcs4}
    ${subfolder_srcs5}
)

# 添加源文件到动态链接库 
#add_library(device            ${subfolder_srcs0})
#add_library(graphics          ${subfolder_srcs1})
#add_library(machine_learning  ${subfolder_srcs2})
#add_library(mcu               ${subfolder_srcs3})
#add_library(scientific        ${subfolder_srcs4})
#add_library(standard_template ${subfolder_srcs5})


#add_subdirectory(device)
#add_subdirectory(graphics)
#add_subdirectory(machine_learning)
#add_subdirectory(mcu)
#add_subdirectory(scientific)
#add_subdirectory(standard_template)






